Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

labelService: allow extensions to contribute label formatting rules #66352

Merged
merged 7 commits into from
Jan 18, 2019

Conversation

isidorn
Copy link
Contributor

@isidorn isidorn commented Jan 10, 2019

fixes #66209
Now it is possible for extensions to contribute label formatting rules. Here's how such a contribution would look like inside a package.json for example.

"contributes": {
		"resourceLabelFormatters": [
			{
				  "scheme": "vscode",
                                  "authority": "wsl*",
                                  "formatting": {
				      "label": "${path}",
				      "separator": "/",
				      "tildify": true,
				      "workspaceSuffix": "WSL"
                                 }
			} 
		]
}

I will present this tomorrow in standup so we can discuss than more.

fyi @alexandrudima @chrmarti @egamma

@isidorn isidorn added this to the December/January 2019 milestone Jan 10, 2019
@isidorn isidorn self-assigned this Jan 10, 2019
@alexdima
Copy link
Member

alexdima commented Jan 11, 2019

👍 Nice! As a quick feedback, I think labels might be too generic for the extension point.

@isidorn
Copy link
Contributor Author

isidorn commented Jan 11, 2019

Thanks for feedback. Here's some alternative names
labelDisplayRules
labelsDisplay
uriLabels
uriLabelRules

Also to debate: "prefix" should it be a field or a key. Also the name does not reflect the importance. Should it just be a match?

@roblourens
Copy link
Member

How loose is "authority": "wsl*", would it match wsl2+something or only wsl+something?

@roblourens
Copy link
Member

roblourens commented Jan 14, 2019

  • "tildify": true, - How do we determine the home directory on the remote?
  • normalizeDriveLetter Why should the extension author control this? Is this true when the remote is windows and false when it isn't?
  • "separator": "/", Should this be a bool to pick forward/back slashes, or is there a use case for arbitrary strings as path separators?

@isidorn
Copy link
Contributor Author

isidorn commented Jan 15, 2019

@roblourens for now we would only support the * as a prefix. However the exact rules of this can be broadened and we do not have to specify them from start.
Determining the homeDirecotry on the remote would have to come from the environmentService. So if that one is proper the label would properly be tildified
I agree, let's remove the normalizeDriveLetter for now
seperator leaving it as a string gives us more flexibility. Yes it could be boolean, but for now I would keep it as a string

Thanks for feedback

@isidorn isidorn merged commit 2494a5f into master Jan 18, 2019
@isidorn isidorn deleted the isidorn/contributes-labels branch January 18, 2019 12:49
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Label service rules should be contributable via extension
3 participants